/*
Date:20210821 PM
key:就是个DFS，不过呢就是最外层循环加一个计数器而已
*/
func DFS(isConnected [][]int,vis []bool,now int){
    if(vis[now]){
        vis[now]=false
        //fmt.Print(now)
        for i:=0;i<len(isConnected);i++{
            if(isConnected[now][i]==1){
                DFS(isConnected,vis,i)
            }
        }
    }
    return
}
func findCircleNum(isConnected [][]int) int {
count:=0
//简单dfs算法
vis:=make([]bool,len(isConnected))
for i:=0;i<len(isConnected);i++{
    vis[i]=true
}
for i:=0;i<len(isConnected);i++{
    if(vis[i]){
    for _,con:=range vis{
        if(con==true){count++
        break}
    }
    }
    DFS(isConnected,vis,i)

}
return count
}
